//
//  Word.m
//  HotWord
//
//  Created by Rainbow on 8/23/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "Word.h"


@implementation Word
@synthesize wordId;
@synthesize content;
@synthesize slug;
@synthesize meanings;
@synthesize timestamp;

-(id)init
{
    self = [super init];
    if (self) {
        meanings = [[NSMutableArray alloc] init];
    }
    return self;
}

- (void)encodeWithCoder:(NSCoder *)aCoder
{
	[aCoder encodeObject:self.wordId forKey:@"wordId"];
	[aCoder encodeObject:self.content forKey:@"content"];
	[aCoder encodeObject:self.slug forKey:@"slug"];
	[aCoder encodeObject:self.meanings forKey:@"meanings"];
	[aCoder encodeObject:self.timestamp forKey:@"timestamp"];
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
	if ([self init]) {
		self.wordId= [aDecoder decodeObjectForKey:@"wordId"];
		self.content = [aDecoder decodeObjectForKey:@"content"];
		self.slug = [aDecoder decodeObjectForKey:@"slug"];
		self.meanings= [aDecoder decodeObjectForKey:@"meanings"];
		self.timestamp= [aDecoder decodeObjectForKey:@"timestamp"];
    }
	return self;
}

-(void)dealloc
{
    self.timestamp = nil;
    self.wordId = nil;
    self.content = nil;
    self.slug = nil;
    self.meanings = nil;
    [super dealloc];
}

@end
